<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Bel_File_Uploader</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Bel_File_Uploader</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">File uploader class. Could upload multiple files. Uses Zend_File_Transfer_Adapter_Http as superclass.</p>
<p class="description"><p>Zend_File_Transfer_Adapter_Http could not rename files after multiple upload. This bug was fixed here  (see _addRenameFilter() &amp; _getRenameFilter()). Also were added methods to set validators that makes  uploader ussage more flexible.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Konstantin Shamko &lt;<a href="mailto:konstantin.shamko@gmail.com">konstantin.shamko@gmail.com</a>&gt;</li>
				<li><span class="field">version:</span> 0.0.1</li>
				<li><span class="field">copyright:</span> Copyright (c) 2009 Konstantin Shamko</li>
				<li><span class="field">license:</span> New</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_Libs---Bel---File---Uploader.php.html">/Libs/Bel/File/Uploader.php</a> (line <span class="field">16</span>)
		</p>
		
				
		<pre>Zend_File_Transfer_Adapter_Http
   |
   --Bel_File_Uploader</pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																				
												<div class="method-definition">
											<span class="method-result">Zend_File_Transfer_Adapter</span>
										<a href="#ignoreNoFile" title="details" class="method-name">ignoreNoFile</a>
											(<span class="var-type">bool</span>&nbsp;<span class="var-name">$ignore</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">Zend_File_Transfer_Adapter</span>
										<a href="#isImage" title="details" class="method-name">isImage</a>
											([<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">bool</span>
										<a href="#receive" title="details" class="method-name">receive</a>
											([<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">Zend_File_Transfer_Adapter</span>
										<a href="#setAllowedExtensions" title="details" class="method-name">setAllowedExtensions</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$extensions</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">Zend_File_Transfer_Adapter</span>
										<a href="#setAllowedMimeTypes" title="details" class="method-name">setAllowedMimeTypes</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$mimetypes</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>], <span class="var-type">array</span>&nbsp;<span class="var-name">$extensions</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">Zend_File_Transfer_Adapter</span>
										<a href="#setFileSize" title="details" class="method-name">setFileSize</a>
											([<span class="var-type">integer</span>&nbsp;<span class="var-name">$min</span> = <span class="var-default">null</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$max</span> = <span class="var-default">null</span>], [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">Zend_File_Transfer_Adapter</span>
										<a href="#setForbiddenExtensions" title="details" class="method-name">setForbiddenExtensions</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$extensions</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">Zend_File_Transfer_Adapter</span>
										<a href="#setForbiddenMimeTypes" title="details" class="method-name">setForbiddenMimeTypes</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$mimetypes</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>], <span class="var-type">array</span>&nbsp;<span class="var-name">$extensions</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">Zend_File_Transfer_Adapter</span>
										<a href="#setImageSize" title="details" class="method-name">setImageSize</a>
											([<span class="var-type">array</span>&nbsp;<span class="var-name">$min</span> = <span class="var-default">null</span>], [<span class="var-type">array</span>&nbsp;<span class="var-name">$max</span> = <span class="var-default">null</span>], <span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">bool</span>
										<a href="#upload" title="details" class="method-name">upload</a>
											([<span class="var-type">bool</span>&nbsp;<span class="var-name">$rename</span> = <span class="var-default">true</span>])
									</div>
								</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>

<a name="methodignoreNoFile" id="ignoreNoFile"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">ignoreNoFile</span> (line <span class="line-number">103</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Set ignore ot not when files where not sent by form</p>
	<ul class="tags">
				<li><span class="field">return:</span> *</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Zend_File_Transfer_Adapter</span>
		<span class="method-name">
			ignoreNoFile
		</span>
					(<span class="var-type">bool</span>&nbsp;<span class="var-name">$ignore</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">bool</span>
				<span class="var-name">$ignore</span><span class="var-description">: - true to ignore when files where not sent by form</span>			</li>
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$files</span><span class="var-description">: (Optional) Files to set the options for</span>			</li>
				</ul>
		
			
	</div>
<a name="methodisImage" id="isImage"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">isImage</span> (line <span class="line-number">80</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Will check if $files are images</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Zend_File_Transfer_Adapter</span>
		<span class="method-name">
			isImage
		</span>
					([<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$files</span><span class="var-description">: - Files to limit this validator to</span>			</li>
				</ul>
		
			
	</div>
<a name="methodreceive" id="receive"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">receive</span> (line <span class="line-number">156</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Receive the file from the client (Upload). Don't use it to upload files. Use upload() method  instead. receive() method was written here to fix bug with files renaming after upload.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			receive
		</span>
					([<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$files</span><span class="var-description">: (Optional) Files to receive</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetAllowedExtensions" id="setAllowedExtensions"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">setAllowedExtensions</span> (line <span class="line-number">25</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Set allowed file extensions</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Zend_File_Transfer_Adapter</span>
		<span class="method-name">
			setAllowedExtensions
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$extensions</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$extensions</span><span class="var-description">: - array with extensions</span>			</li>
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$files</span><span class="var-description">: - Files to limit this validator to</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetAllowedMimeTypes" id="setAllowedMimeTypes"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">setAllowedMimeTypes</span> (line <span class="line-number">47</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Set allowed file mime types</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Zend_File_Transfer_Adapter</span>
		<span class="method-name">
			setAllowedMimeTypes
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$mimetypes</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>], <span class="var-type">array</span>&nbsp;<span class="var-name">$extensions</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$extensions</span><span class="var-description">: - array with extensions</span>			</li>
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$files</span><span class="var-description">: - Files to limit this validator to</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$mimetypes</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetFileSize" id="setFileSize"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">setFileSize</span> (line <span class="line-number">70</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Set file size</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Zend_File_Transfer_Adapter</span>
		<span class="method-name">
			setFileSize
		</span>
					([<span class="var-type">integer</span>&nbsp;<span class="var-name">$min</span> = <span class="var-default">null</span>], [<span class="var-type">integer</span>&nbsp;<span class="var-name">$max</span> = <span class="var-default">null</span>], [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$min</span><span class="var-description">: - min diskspace for $files</span>			</li>
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$max</span><span class="var-description">: - max diskspace for $files</span>			</li>
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$files</span><span class="var-description">: - Files to limit this validator to</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetForbiddenExtensions" id="setForbiddenExtensions"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">setForbiddenExtensions</span> (line <span class="line-number">36</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Set forbidden file extensions</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Zend_File_Transfer_Adapter</span>
		<span class="method-name">
			setForbiddenExtensions
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$extensions</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$extensions</span><span class="var-description">: - array with extensions</span>			</li>
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$files</span><span class="var-description">: - Files to limit this validator to</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetForbiddenMimeTypes" id="setForbiddenMimeTypes"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">setForbiddenMimeTypes</span> (line <span class="line-number">58</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets forbidden file mime types</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Zend_File_Transfer_Adapter</span>
		<span class="method-name">
			setForbiddenMimeTypes
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$mimetypes</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span> = <span class="var-default">null</span>], <span class="var-type">array</span>&nbsp;<span class="var-name">$extensions</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$extensions</span><span class="var-description">: - array with extensions</span>			</li>
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$files</span><span class="var-description">: - Files to limit this validator to</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$mimetypes</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetImageSize" id="setImageSize"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">setImageSize</span> (line <span class="line-number">92</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Will check min &amp; max image size</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Zend_File_Transfer_Adapter</span>
		<span class="method-name">
			setImageSize
		</span>
					([<span class="var-type">array</span>&nbsp;<span class="var-name">$min</span> = <span class="var-default">null</span>], [<span class="var-type">array</span>&nbsp;<span class="var-name">$max</span> = <span class="var-default">null</span>], <span class="var-type">string|array</span>&nbsp;<span class="var-name">$files</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$min</span><span class="var-description">: - array with min image dimensions (array(width, height))</span>			</li>
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$max</span><span class="var-description">: - array with max image dimensions (array(width, height))</span>			</li>
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$files</span><span class="var-description">: - Files to limit this validator to</span>			</li>
				</ul>
		
			
	</div>
<a name="methodupload" id="upload"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">upload</span> (line <span class="line-number">113</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Upload files</p>
	<ul class="tags">
				<li><span class="field">return:</span> - true if ok</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			upload
		</span>
					([<span class="var-type">bool</span>&nbsp;<span class="var-name">$rename</span> = <span class="var-default">true</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">bool</span>
				<span class="var-name">$rename</span><span class="var-description">: - if true files will be renamed after upload with unique random names</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Mon, 01 Mar 2010 18:58:53 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.0</a>
	</p>
	</div></body>
</html>